package java67_adv4;

import java.util.*;
import java.time.*;

public class CalTest {

	public static void main(String[] args) {
		// Calendar
		Calendar c = Calendar.getInstance();
		System.out.println(c.getClass().getName());
		int year = c.get(Calendar.YEAR);
		int m = c.get(Calendar.MONTH) + 1;
		int date = c.get(Calendar.DATE);
		System.out.println(String.format("%d-%d-%d", year, m, date));
		System.out.println(c.get(Calendar.DAY_OF_YEAR));// 150
		System.out.println(c.get(Calendar.WEEK_OF_YEAR));// 22

		c.set(Calendar.MONTH, Calendar.AUGUST);
		c.set(Calendar.DAY_OF_MONTH, 6);
		System.out.println(c);
		System.out.println(c.getTime());
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>");
		// System.out.println(c.getTimeInMillis());
		c.add(Calendar.DATE, 26);// roll
		System.out.println(c.getTime() + "东京奥运会结束");
		c.roll(Calendar.HOUR, 1000);
		System.out.println(c.getTime() + "东京奥运会结束");
		System.out.println(">>>最大值");
		int mday = c.getActualMaximum(Calendar.DAY_OF_YEAR);
		System.out.println(mday);
	}

}
